class PWNPawn extends UTPawn;	
//UTPawn
//GamePawn

//Preliminary Testing Stuff
var bool HasFasterSpeed;
var bool HasHigherJump;
var bool HasSuperHumanAbilities;

//Stats System Base
var float StatsSpeed;
var float StatsJump;
var float StatsDuck;
var float StatsHealth;
var float StatsTimeDilation;
var float StatsTimeDilationDuration;

//Stats System Levels
var int StatsLevelSpeed;
var int StatsLevelSpeedMax;
var int StatsLevelJump;
var int StatsLevelJumpMax;
var int StatsLevelHealth;
var int StatsLevelHealthMax;
var int StatsLevelTimeDilation;
var int StatsLevelTimeDilationMax;
var int StatsLevelTimeDilationDuration;
var int StatsLevelTimeDilationDurationMax;

//Stats System Increases
var() float StatsIncrAmountJump;
var() float StatsIncrAmountSpeed;
var() float StatsIncrAmountHealth;
var() float StatsIncrAmountTimeDilation;
var() float StatsIncrAmountTimeDilationDuration;


//Start
simulated function PostBeginPlay()
{
	super.PostBeginPlay();

	//Todo Set stats values from file	
	PWNPlayerController(GetALocalPlayerController()).PWNPlayerControllerDebugPrint("PWNPlayerController: PWNPawn loaded...");
	SetStats();
		
	//PWNPlayerController(PC).PWNPlayerControllerDebugPrint("yyyyy");
	PWNPawnDebugPrint("Stats:");	 
	//PWNPawnDebugPrint("------");
	StatsSpeedPrint();
	StatsJumpPrint();
	StatsHealthPrint();
	StatsTimeDilationPrint();
	StatsTimeDilationDurationPrint();
	PWNPawnDebugPrint("");
	PWNPawnDebugPrint("Stats Levels:");
	//PWNPawnDebugPrint("------");
	StatsLevelSpeedPrint();
	StatsLevelJumpPrint();
	StatsLevelHealthPrint();
	StatsLevelTimeDilationPrint();
	StatsLevelTimeDilationDurationPrint();
	
}

//Debug Print Function for this class
 simulated private function PWNPawnDebugPrint(string sMessage)
{
	GetALocalPlayerController().ClientMessage(sMessage);
}

private function SetStats()
{
	//Todo: Load from file
	StatsSpeed=GroundSpeed;
	StatsJump=JumpZ;
	StatsHealth=Health;
	//No need to set time dilation now
	//StatsTimeDilation=WorldInfo.TimeDilation;
	//StatsTimeDilationDuration
}

/*******************************/
/**Player movement Stats Increases Start**/
/*******************************/

//Stats Increase
public function StatsIncrJump()
{
	JumpZ += StatsIncrAmountJump;	
	StatsJumpPrint();
}

public function StatsIncrSpeed()
{
	GroundSpeed += StatsIncrAmountSpeed;	
	StatsSpeedPrint();
}

public function StatsIncrHealth()
{
	Health += StatsIncrAmountHealth;	
	StatsHealthPrint();
}

public function StatsIncrTimeDilation()
{
	StatsTimeDilation += StatsIncrAmountTimeDilation;	
	StatsTimeDilationPrint();
}

public function StatsIncrTimeDilationDuration()
{
	StatsTimeDilationDuration += StatsIncrAmountTimeDilationDuration;	
	StatsTimeDilationDurationPrint();
}


//Levels Increase
public function StatsLevelIncrSpeed()
{
	StatsLevelSpeed++;
	StatsLevelSpeedPrint();
}

public function StatsLevelIncrJump()
{
	StatsLevelJump++;
	StatsLevelJumpPrint();
	
}

public function StatsLevelIncrHealth()
{
	StatsLevelHealth++;
	StatsLevelHealthPrint();	
}

public function StatsLevelIncrTimeDilation()
{
	StatsLevelTimeDilation++;
	StatsLevelTimeDilationPrint();	
}

public function StatsLevelIncrTimeDilationDuration()
{
	StatsLevelTimeDilationDuration++;
	StatsLevelTimeDilationDurationPrint();	
}

//Print stats

public function StatsJumpPrint()
{
	PWNPawnDebugPrint("Jump is now: " $StatsJump);
}

public function StatsSpeedPrint()
{
	PWNPawnDebugPrint("Speed is now: " $StatsSpeed);
}

public function StatsHealthPrint()
{
	PWNPawnDebugPrint("Health is now: " $StatsHealth);
}

public function StatsTimeDilationPrint()
{
	PWNPawnDebugPrint("Time dilation is now: " $StatsTimeDilation);
}

public function StatsTimeDilationDurationPrint()
{
	PWNPawnDebugPrint("Time dilation duration is now: " $StatsTimeDilationDuration);
}

public function StatsPrintAll()
{
	StatsJumpPrint();
	StatsSpeedPrint();
	StatsHealthPrint();
	StatsTimeDilationPrint();
	StatsTimeDilationDurationPrint();
}

//Print levels
public function StatsLevelJumpPrint()
{
	PWNPawnDebugPrint("Jump level is now: " $StatsLevelJump);
}

public function StatsLevelSpeedPrint()
{
	PWNPawnDebugPrint("Speed level is now: " $StatsLevelSpeed);
}

public function StatsLevelHealthPrint()
{
	PWNPawnDebugPrint("Health level is now: " $StatsLevelHealth);
}

public function StatsLevelTimeDilationPrint()
{
	PWNPawnDebugPrint("Time dilation level is now: " $StatsLevelTimeDilation);
}

public function StatsLevelTimeDilationDurationPrint()
{
	PWNPawnDebugPrint("Time dilation level is now: " $StatsLevelTimeDilationDuration);
}

public function StatsLevelPrintAll()
{
	StatsLevelJumpPrint();
	StatsLevelSpeedPrint();
	StatsLevelHealthPrint();
	StatsLevelTimeDilationPrint();
	StatsLevelTimeDilationDurationPrint();
}
/*****************************/
/**Player movement Stats End**/
/*****************************/


//Reset Stats function
function StatsIncrReset()
{
	PWNPawnDebugPrint("I've called the ResetStatsFunction");
	
	JumpZ = default.JumpZ;
	StatsJump = default.JumpZ;

	GroundSpeed = default.GroundSpeed;
	StatsSpeed = default.GroundSpeed;

	Health = default.StatsHealth;
	StatsHealth = default.StatsHealth;

	WorldInfo.TimeDilation =  default.StatsTimeDilation;
	StatsTimeDilation =  default.StatsTimeDilation;

	StatsTimeDilationDuration = default.StatsTimeDilationDuration;

	StatsSpeedPrint();
	StatsLevelSpeedPrint();
	
	StatsJumpPrint();
	StatsLevelJumpPrint();
	
	StatsHealthPrint();
	StatsLevelHealthPrint();

	StatsTimeDilationPrint();
	StatsLevelTimeDilationPrint();	

}


/**************************/
/**Kismet Functions Start**/
/**************************/
//Increase Pawn Speed
public function SpeedIncrease(PWNKisFunc_SpeedIncr SpeedAction)
	{		
		
		GroundSpeed += SpeedAction.SpeedIncreaseAmount;
		HasFasterSpeed=true;		
		IsSuperBeing();		
		StatsSpeed=GroundSpeed;
		StatsSpeedPrint();
	}

//Increase Pawn Jump
public function JumpIncrease(PWNKisFunc_JumpIncr JumpAction)
	{
		JumpZ += JumpAction.JumpHeightIncreaseAmount;
		HasHigherJump=true;		
		IsSuperBeing();
		StatsJump=JumpZ;
		StatsJumpPrint();
	}

//Send ClientMessage from Kismet
function SendClientMessage(PWNKis_Func_SendClientMessage ClientMessageToSend)
{	
	ClientMessage(ClientMessageToSend.MessageToSend);
}

//Check if player has picked up 
private function IsSuperBeing()
	{	
			if((HasHigherJump)&&(HasFasterSpeed))
				{					
					HasSuperHumanAbilities=true;
					ClientMessage("You are now a fuckin' SuperHuman!");										
					//UTAnnouncer.PlayAnnouncement(
					

				}	
	}

/************************/
/**Kismet Functions End**/
/************************/




defaultproperties
{
	Name="Default__PWNPawn"
	GroundSpeed = 440.0
	AirSpeed = 440.0	
	JumpZ=322.0
	Health=100.0
	
	//StatsSystemDefaults
	StatsSpeed=440.0
	StatsJump=322.0	
	StatsHealth=100
	StatsTimeDilation = 0.3
	StatsTimeDilationDuration = 2

	//StatsLevelDefaults
	StatsLevelSpeed=1
	StatsLevelSpeedMax=2

	StatsLevelJump=1
	StatsLevelJumpMax=2

	StatsLevelHealth=1
	StatsLevelHealthMax=2	

	StatsLevelTimeDilation=1
	StatsLevelTimeDilationMax=2

	StatsLevelTimeDilationDuration=1
	StatsLevelTimeDilationDurationMax=2


	//StatsIncreaseDefaults
	StatsIncrAmountJump=300
	StatsIncrAmountSpeed=300
	StatsIncrAmountHealth=50
	StatsIncrAmountTimeDilation=0.2
	StatsIncrAmountTimeDilationDuration=3

	//OtherCheckDefaults
	HasFasterSpeed = false
	HasHigherJump = false
	HasSuperHumanAbilities = false
	

	HealthMax = 1000
	
	//AccelRate=2000.0
	//AirControl=0.0
	//AirSpeed=0.0	
	//EyeHeight = 60;
	//MaxFallSpeed = 2000;
	
}